package com.itron.base.controller;

import com.itron.base.model.vo.ResultVO;
import com.itron.base.util.MailUtil;
import com.itron.base.util.ResultUtil;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DemoController {
    @ResponseBody
    @RequestMapping("/sentMail")
    public ResultVO sentMail(String mail, String text,String token) {
        if(MailUtil.sendSimpleMail(mail, text)) {
            return ResultUtil.success();
        }else {
            return ResultUtil.error("send error");
        }

    }

    @ResponseBody
    @RequestMapping("/testToken")
    public ResultVO testToken(String token) {
        System.out.println(token);
       return ResultUtil.success();
    }
}
